import Vue from 'vue';
import App from './App';
import store from './store'; // store
import plugins from './plugins'; // plugins
import './permission'; // permission
import './static/font/iconfont.css';
Vue.use(plugins);

import {
	getDicts
} from '@/api/system/dict/data';
import {
	toParams,
	validData,
	isEmpty
} from '@/utils/common';
import {
	checkPermi,
	checkRole
} from '@/utils/permission';
// 字典标签组件
import DictTag from '@/components/DictTag';
// 字典数据组件
import DictData from '@/components/DictData';
import baTreePicker from '@/components/ba-tree-picker/ba-tree-picker.vue';
import EmptyInput from '@/components/EmptyInput/index.vue';
import NoData from '@/components/no-data.vue';
import Search from '@/components/search.vue';
import ImageCommon from '@/components/image-common.vue';
import ExamFlow from '@/components/exam-flow.vue';
import SearchTime from '@/components/searchTime.vue';
import LinkageSelect from '@/components/linkageSelect.vue';
import SelectCorporation from '@/components/selectCorporation.vue';
//选择框
// import ZxzUniDataSelect from "@/uni_modules/zxz-uni-data-select/components/zxz-uni-data-select/zxz-uni-data-select.vue";

// 注册全局过滤器
import * as filters from '@/utils/filters';
for (const key in filters) {
	Vue.filter(key, filters[key]);
}

Vue.prototype.toParams = toParams;
Vue.prototype.validData = validData;

// 全局方法挂载
Vue.prototype.checkPermi = checkPermi;
Vue.prototype.checkRole = checkRole;
Vue.prototype.getDicts = getDicts;
Vue.prototype.isEmpty = isEmpty;
Vue.config.productionTip = false;
Vue.prototype.$store = store;

// 全局组件挂载
Vue.component('DictTag', DictTag);
Vue.component('baTreePicker', baTreePicker);
Vue.component('EmptyInput', EmptyInput);
Vue.component('NoData', NoData);
Vue.component('Search', Search);
Vue.component('ImageCommon', ImageCommon);
Vue.component('ExamFlow', ExamFlow);
Vue.component('SearchTime', SearchTime);
Vue.component('LinkageSelect', LinkageSelect);
Vue.component('SelectCorporation', SelectCorporation);
// Vue.component('ZxzUniDataSelect', ZxzUniDataSelect);
DictData.install();

import ASelectUni from '@/components/SelectPicker/selectUni.vue';
Vue.component('ASelectUni', ASelectUni);

import ARadioGroup from '@/pages/quota/AForm/radioGroup/index.vue';
Vue.component('ARadioGroup', ARadioGroup);
import AInput from '@/pages/quota/AForm/input/index.vue';
Vue.component('AInput', AInput);
import ACollapse from '@/pages/quota/AForm/collapse/index.vue';
Vue.component('ACollapse', ACollapse);
import ADatePicker from '@/pages/quota/AForm/datePicker/index.vue';
Vue.component('ADatePicker', ADatePicker);
import ATab from '@/pages/quota/AForm/tab/index.vue';
Vue.component('ATab', ATab);

import MescrollMixin from '@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js';

Vue.mixin(MescrollMixin);

import mixins from '@/utils/mixin.js';
Vue.mixin(mixins);
import * as utils from '@/utils/utils.js';

for (const key in utils) {
	Vue.prototype[key] = utils[key];
}

import dayjs from '@/utils/libs/dayjs.min.js'; // ES 2015
dayjs().format();
var calendar = require('@/utils/libs/calendar.js');
dayjs.extend(calendar);
var duration = require('@/utils/libs/duration.js');
dayjs.extend(duration);
var isSameOrAfter = require('@/utils/libs/isSameOrAfter.js');
dayjs.extend(isSameOrAfter);
var isSameOrBefore = require('@/utils/libs/isSameOrBefore.js');
dayjs.extend(isSameOrBefore);
Vue.prototype.$dayjs = dayjs;
// export {
// 	dayjs
// };
export const $dayjs = dayjs;
App.mpType = 'app';

const app = new Vue({
	...App,
});

app.$mount();